package net.huashitong.user.dao;

import com.sirdc.modules.core.dao.GenericQuery;
import com.sirdc.modules.core.dao.StringDao;
import net.huashitong.user.entity.SuperviseUser;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class SuperviseUserDao extends StringDao<SuperviseUser> {

    public List<SuperviseUser> querySuperviseUserListByProjectId(String projectId){
        GenericQuery query = createQuery("obj");
        query.append(" and obj.projectId =:projectId").setParam("projectId",projectId);
        return query.listResult();
    }
    public List<SuperviseUser> querySuperviseUserListByIsLeader(String isLeader){
        GenericQuery query = createQuery("obj");
        query.append(" and obj.isLeader =:isLeader").setParam("isLeader",isLeader);
        return query.listResult();
    }
    public List<SuperviseUser> querySuperviseUserListByPhone(String phone){
        GenericQuery query = createQuery("obj");
        query.append(" and obj.phone =:phone").setParam("phone",phone);
        return query.listResult();
    }
}
